package com.heima.behavior.controller.v1;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.heima.behavior.service.ApFollowBehaviorService;
import com.heima.model.behavior.pojos.ApFollowBehavior;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/v1/follow_behavior")
public class ApFollowBehaviorController {

    @Autowired
    ApFollowBehaviorService apFollowBehaviorService;

    @GetMapping("/getFollowList")
    public List<ApFollowBehavior> getFollowList(@RequestParam("entryID")Integer entryID, @RequestParam("articleID")Long articleID,@RequestParam("userID")Integer userID){
        return apFollowBehaviorService.list(Wrappers.<ApFollowBehavior>lambdaQuery()
        .eq(ApFollowBehavior::getEntryId,entryID)
        .eq(ApFollowBehavior::getArticleId,articleID)
        .eq(ApFollowBehavior::getFollowId,userID));
    }

}
